home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / LanguageAnalysis.p < prev    next >
Text File  |  1996-05-01  |  6KB  |  190 lines

  1. {
  2.      File:        LanguageAnalysis.p
  3.  
  4.      Contains:    Language Analysis Manager Interfaces
  5.  
  6.      Version:    Technology:    System 8
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT LanguageAnalysis;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __LANGUAGEANALYSIS__}
  28. {$SETC __LANGUAGEANALYSIS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC LanguageAnalysisIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __AEDATAMODEL__}
  38. {$I AEDataModel.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __AEREGISTRY__}
  41. {$I AERegistry.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __FILEMANAGERTYPES__}
  44. {$I FileManagerTypes.p}
  45. {$ENDC}
  46. {$IFC UNDEFINED __LOCALEOBJECTS__}
  47. {$I LocaleObjects.p}
  48. {$ENDC}
  49. {$IFC UNDEFINED __DICTIONARY__}
  50. {$I Dictionary.p}
  51. {$ENDC}
  52.  
  53. {$PUSH}
  54. {$ALIGN POWER}
  55. {$LibExport+}
  56.  
  57. {$IFC FOR_SYSTEM8_PREEMPTIVE }
  58. {$IFC FOR_PTR_BASED_AE }
  59.  
  60. TYPE
  61.     LAItemOffset                        = UInt32;
  62.     LAEnvironmentLocaleObjectRef        = LocaleObjectRef;
  63.     LAContextRef = ^LONGINT;
  64.     LAPropertyKey                        = AEKeyword;
  65.     LAPropertyType                        = DescType;
  66. {
  67.     Names for Environment Locale Object Attribute Names and Values
  68. }
  69. {  Japanese Kana-Kanji conversion }
  70. {  Japanese TTS }
  71. {  General Morpheme Analysis }
  72. {
  73.     Tags for Environment Properties
  74. }
  75.  
  76. CONST
  77.     keyAELAAutoLearning            = 'laal';                        {  Boolean }
  78.     keyAELALearningDictionary    = 'lald';                        {  Some permanent file specification }
  79.     keyAELADictionaryList        = 'ladc';                        {  AEList which has a list of dictionary informaion. }
  80.  
  81. {
  82.     Tags for dictionary information
  83. }
  84.     keyAELADictionaryFile        = 'dfil';                        {  Some permanent file specification }
  85.     keyAELADictionaryWeight        = 'dwgt';                        {  Int32 }
  86.     keyAELADictionaryID            = 'did ';                        {  DictionaryID (r/o, volatile) }
  87.  
  88.  
  89. TYPE
  90.     LAMorphemeBundle                    = AERecord;
  91.     LAMorphemeBundlePtr                 = ^LAMorphemeBundle;
  92.     LAMorphemePath                        = AERecord;
  93.     LAMorphemePathPtr                     = ^LAMorphemePath;
  94.     LAMorpheme                            = AERecord;
  95.     LAMorphemePtr                         = ^LAMorpheme;
  96.     LAHomograph                            = AERecord;
  97.     LAHomographPtr                         = ^LAHomograph;
  98.  
  99. CONST
  100.     typeLAMorphemeBundle        = 'lmfb';
  101.     typeLAMorphemePath            = 'lmfp';
  102.     typeLAMorpheme                = 'lmfn';
  103.     typeLAHomograph                = 'lmfh';
  104.  
  105.     keyAELAMorphemeBundle        = 'lmfb';
  106.     keyAELAMorphemePath            = 'lmfp';
  107.     keyAELAMorpheme                = 'lmfn';
  108.     keyAELAHomograph            = 'lmfh';
  109.  
  110.     kLADefaultEdge                = 0;
  111.     kLAFreeEdge                    = 1;
  112.     kLAIncompleteEdge            = 2;
  113.  
  114.     kAllMorphemes                = -1;
  115.  
  116.     kNoContext                    = 0;
  117.  
  118.  
  119. TYPE
  120.     LAFeedbackType                        = OptionBits;
  121.  
  122. CONST
  123.     kLAAcceptedAsIs                = 0;
  124.     kLAHomophoneSelected        = $01;
  125.     kLALocalReanalysis            = $02;
  126.     kLATransLiterate            = $04;
  127.  
  128. {
  129.     Error Value
  130. }
  131.     laEngineNotFoundErr            = -7000;                        {  can't find the engine }
  132.     laPropertyErr                = -7001;                        {  Error in properties }
  133.     laPropertyNotFoundErr        = -7002;                        {  can't find the property }
  134.     laPropertyIsReadOnlyErr        = -7003;                        {  the property is read only }
  135.     laPropertyUnknownErr        = -7004;                        {  the property is unknown to this environment }
  136.     laPropertyValueErr            = -7005;                        {  Invalid property value }
  137.     laDictionaryTooManyErr        = -7006;                        {  too many dictionaries }
  138.     laDictionaryUnknownErr        = -7007;                        {  can't use this dictionary with this environment }
  139.     laDictionaryNotOpenedErr    = -7008;                        {  the dictionary is not opened }
  140.     laTextOverFlowErr            = -7009;                        {  text is too long }
  141.     laFailAnalysisErr            = -7010;                        {  analysis failed }
  142.     laNoMoreMorphemeErr            = -7011;                        {  nothing to read }
  143.  
  144. {
  145.     Handling Context
  146. }
  147. FUNCTION LAOpenContext(environ: LAEnvironmentLocaleObjectRef; VAR context: LAContextRef; VAR specificErr: OSStatus; VAR which: AERecord): OSStatus; C;
  148. FUNCTION LACloseContext(context: LAContextRef): OSStatus; C;
  149. {
  150.     Handling Environment
  151. }
  152. FUNCTION LAGetEnvironmentProperty(environment: LAEnvironmentLocaleObjectRef; propertyKey: LAPropertyKey; desiredType: LAPropertyType; maxSize: ByteCount; VAR actualType: LAPropertyType; VAR actualSize: ByteCount; value: LogicalAddress): OSStatus; C;
  153. FUNCTION LASetEnvironmentProperty(environment: LAEnvironmentLocaleObjectRef; propertyKey: LAPropertyKey; propertyType: LAPropertyType; valueSize: ByteCount; value: ConstLogicalAddress; VAR specificErr: OSStatus): OSStatus; C;
  154. {
  155.     Handling dictionries
  156. }
  157. FUNCTION LAOpenDictionary(environ: LAEnvironmentLocaleObjectRef; dictionaryID: DCMDictionaryID; VAR dictionaryProperty: AERecord): OSStatus; C;
  158. FUNCTION LACloseDictionary(environ: LAEnvironmentLocaleObjectRef; dictionary: DCMDictionaryID): OSStatus; C;
  159. FUNCTION LAListAvailableDictionary(environ: LAEnvironmentLocaleObjectRef; maxCount: ItemCount; VAR actualCount: ItemCount; VAR dictionaryList: DCMDictionaryID): OSStatus; C;
  160. {
  161.     Analyzing text
  162. }
  163. FUNCTION LAMorphemeAnalysis(context: LAContextRef; text: ConstTextObject; VAR leadingPath: LAMorphemePath; VAR trailingPath: LAMorphemePath; pathCount: ItemCount; VAR result: LAMorphemeBundle): OSStatus; C;
  164. FUNCTION LAContinuousMorphemeAnalysis(context: LAContextRef; text: ConstTextObject; incrementalText: BOOLEAN; VAR leadingPath: LAMorphemePath; VAR trailingPath: LAMorphemePath; VAR modified: BOOLEAN): OSStatus; C;
  165. FUNCTION LAGetMorphemes(context: LAContextRef; VAR result: LAMorphemePath): OSStatus; C;
  166. FUNCTION LAShiftMorphemes(context: LAContextRef; morphemeCount: ItemCount; VAR path: LAMorphemePath; VAR byteCount: ByteCount): OSStatus; C;
  167. FUNCTION LAResetAnalysis(context: LAContextRef): OSStatus; C;
  168. FUNCTION LAGetAllHomographs(context: LAContextRef; {CONST}VAR path: LAMorphemePath; morphemeOffset: LAItemOffset; VAR morpheme: LAMorpheme): OSStatus; C;
  169. FUNCTION LAGetRootForm(context: LAContextRef; {CONST}VAR path: LAMorphemePath; morphemeOffset: LAItemOffset; VAR rootForm: LAMorphemePath): OSStatus; C;
  170. {
  171.     Learning
  172. }
  173. FUNCTION LAFeedbackPath(context: LAContextRef; path: LAMorphemePath; startingPosition: LAItemOffset; morphemeCount: ItemCount; VAR feedbackType: LAFeedbackType; confirmed: BOOLEAN): OSStatus; C;
  174. {
  175.     TextObject interface
  176. }
  177. FUNCTION LAAnnotateTextObjectWithMorpheme(analysisClass: Str255; tagCount: ItemCount; VAR tags: DCMFieldTag; text: TextObject): OSStatus; C;
  178. {$ENDC}
  179. {$ENDC}
  180. {$ALIGN RESET}
  181. {$POP}
  182.  
  183. {$SETC UsingIncludes := LanguageAnalysisIncludes}
  184.  
  185. {$ENDC} {__LANGUAGEANALYSIS__}
  186.  
  187. {$IFC NOT UsingIncludes}
  188.  END.
  189. {$ENDC}
  190.